<template>
	<view >
		<u-popup v-model="popupShow" mode="bottom" width="750rpx" height="1080rpx" border-radius="16" :mask-close-able="false">
			<view class="popup_box">
				<view class="header">
					<view class="left">
						选择上课场地
					</view>
					<u-icon name="close" color="#666666" size="34" @click="close"></u-icon>
				</view>
				<scroll-view scroll-y="true" style="height: 850rpx">
					<view class="comlum_box">
						<view v-for="(item,index) in FieldList" :key="index" class="item_box">
							<image :src="item.category_image" mode="aspectFill" class="tag-img" v-if="item.category_image"></image>
							<view class="title">
								{{item.name}}
							</view>
							<view class="tag_box">
								{{item.is_recently ? '最近':''}}
							</view>
							<view class="flex">
							</view>
							<view class="distance" @click="changeActiveIndex(index)">
								<view class="size_s">
									{{item.distance}}
								</view>
								<image :src="activeIndex == index ?$IMG_URL('/static/member/agreement2.png'):$IMG_URL('/static/member/agreement1.png')" mode="" class="radio"></image>
							</view>
						</view>
					</view>
				</scroll-view>
				<view class="btn" @click="sure">
					我知道了
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default{
		props: {
			popupShow: {
				type: Boolean,
				default: false,
				required: true
			},
			FieldList:{
				type: Array,
				default: [],
				required: true
			},
			activeIndex:{
				type:Number,
				default: 0,
				required: true
			}
		},
		data(){
			return{
				
			}
		},
		methods:{
			sure(){
				this.$emit('sure', false)
			},
			close(){
				this.$emit('close')
			},
			changeActiveIndex(index){
				this.$emit('changeActiveIndex', index)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.popup_box{
		width: 750rpx;
		height: 1080rpx;
		padding: 36rpx 40rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		.header{
			width: 100%;
			display: flex;
			flex-direction: row;
			align-items: center;
			.left{
				font-size: 36rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: left;
				color: #333333;
				flex: 1;
			}
		}
		
		.comlum_box{
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;
			padding-top: 48rpx;
			.item_box{
				display: flex;
				flex-direction: row;
				align-items: center;
				width: 100%	;
				height: 88rpx;
				background: #f6f6f6;
				border-radius: 16rpx;
				margin-bottom: 24rpx;
				padding: 0 32rpx;
				.tag-img{
					width: 106rpx;
					height: 32rpx;
					margin-right: 12rpx;
				}
				
				.title{
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: left;
					color: #333333;
					margin-right: 10rpx;
				}
				.tag_box{
					width: 52rpx;
					height: 30rpx;
					background: #f6f6f6;
					border-radius: 4rpx;
					font-size: 20rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: left;
					color: #666666;
					display: flex;
					align-items: center;
					justify-content: center;
				}
				
				.flex{
					flex: 1;
				}
				
				.distance{
					display: flex;
					flex-direction: row;
					align-items: center;
					.size_s{
						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC-Medium;
						font-weight: 500;
						color: #999999;
						margin-right: 16rpx;
					}
					.radio{
						width: 36rpx;
						height: 36rpx;
						border: 2rpx solid #73F0EA;
						border-radius: 50%;
					}
				}
			}
		}
		.btn{
			width: 710rpx;
			height: 88rpx;
			background: #73F0EA;
			border-radius: 16rpx;
			font-size: 34rpx;
			font-family: PingFang SC, PingFang SC-Bold;
			font-weight: 700;
			text-align: center;
			color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>